﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Domain;
using Domain.Common;

namespace Service
{
   public class GameService
    {
       public static void StartGameSync()
       {
           Thread th = new Thread(StartToWork);
           th.Start();
       }

       private static void StartToWork()
       {
           int days = 5;
           foreach (KeyValuePair<short, Force> pair in Force.Forces)
           {
               Force.CurrentWorkForce = pair.Value;
               //Thread.Sleep(10000);
               pair.Value.ApointBuildingEphor();
               InternalService.StartToInternalWork(pair.Value,days);
               TalentsService.StartToTalentsWork(pair.Value, days);
           }
           HistoryDate.CurrentDate = HistoryDate.CurrentDate.AddDays(5);
           Force.CurrentWorkForce=Force.PlayForce;
       }
    }
}
